<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <p>当前的城市：</p>
  <p>当前的温度：</p>
  <p>当前的天气：</p>
  <p>当前的风向：</p>
  <p>当前的风速：</p>
  <p>PM2/5：</p>
</body>
<script>
  var url = 'https://api.muxiaoguo.cn/api/tianqi?city=成都&type=1&api_key=09d664ccb044efc8'
  fetch(url).then(function (res) {
    return res.json()
  }).then(function (data) {
    console.log(data)
    console.log(data.data.cityname)
    var ps = document.getElementsByTagName('p')
    ps[0].innerText += data.data.cityname
    ps[1].innerText += data.data.temp
    ps[2].innerText += data.data.weather
    ps[3].innerText += data.data.WD
    ps[4].innerText += data.data.WS
    ps[5].innerText += data.data.pm25
  })
</script>

</html>